﻿using System;
using System.Collections.ObjectModel;
using Highcharts.Core;
using Highcharts.Core.Appearance;
using Highcharts.Core.Data.Chart;

namespace DemoWebforms
{
    public partial class Sample05 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Exemplo05();
        }
        
        private void Exemplo05()
        {

            hcVendas.Title = new Title("Faturamento anual e-commerce");
            hcVendas.SubTitle = new SubTitle("valores brutos");

            //definições de eixos
            hcVendas.YAxis.Add(new YAxisItem { title = new Title("Faturamento por setor") });
            hcVendas.XAxis.Add(new XAxisItem { categories = new object[] { "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002" } });

            //dados
            var series = new Collection<Serie>();
            series.Add(new Serie { data = new object[] { 400, 435, 446, 479, 554, 634, 687, 750, 831 }, name = "Eletrônicos"});
            series.Add(new Serie { data = new object[] { 254, 402, 576, 85, 257, 684, 601, 410, 543 }, name = "Vestuários"});
            series.Add(new Serie { data = new object[] { 125, 471, 247, 120, 397, 451 }, name = "Esportes" });

            hcVendas.Theme = "gray";
            hcVendas.Legend = new Legend { align = Align.right, layout = Layout.vertical, verticalAlign = VerticalAlign.top, x = -10, y = 70, borderWidth = 0 };
            hcVendas.Appearance = new Appearance { marginBottom = 30, marginRight = 130, borderRadius = 15 };            

            //bind do controle
            hcVendas.DataSource = series;
            hcVendas.DataBind();

        }
    }
}